Maple Tool 1
This tool is designed to be used with Activity 1 in Section 10.3.1.
> | with(plots): with(stats[statplots]): f:=x->exp(x); |
Warning, the name changecoords has been redefined
Here are the first nine Taylor polynomials for the exponential function at .
> | P[0]:=x->1; P[1]:=x->P[0](x)+x; P[2]:=x->P[1](x)+x^2/2; P[3]:=x->P[2](x)+x^3/(3!); P[4]:=x->P[3](x)+x^4/(4!); P[5]:=x->P[4](x)+x^5/(5!); P[6]:=x->P[5](x)+x^6/(6!); P[7]:=x->P[6](x)+x^7/(7!); P[8]:=x->P[7](x)+x^8/(8!); |
Now we examine the convergence of the polynomial approximations at a particular point . The following code will display a graph of the function , graphs of the first nine Taylor polynomial approximations , and the first nine Taylor approximations at the particular pont .
Enter a value of between and .
> | x[0]:=3; |
Below the plot we list the approximating values together with the value of and the error in the last approximation. The viewing window may be altered by varying the definitions of the constants and .
> | a:=4; b:=60; PlotA:=plot(f(x),x=-a..a, thickness=3, color=red, xtickmarks=[-a,-a/2,a/2,a], ytickmarks=[-b,-b/2,b/2,b], view=[-a..a,-b..b]): |
> | xdata:=[x[0],x[0],x[0],x[0],x[0],x[0],x[0],x[0],x[0]]: ydata:=[P[0](x[0]), P[1](x[0]), P[2](x[0]), P[3](x[0]),P[4](x[0]), P[5](x[0]), P[6](x[0]), P[7](x[0]), P[8](x[0])]: PlotF:=scatterplot(xdata, ydata, color=navy): PlotG:=plot([P[0](x), P[1](x), P[2](x), P[3](x), P[4](x), P[5](x), P[6](x), P[7](x), P[8](x)], x=-a..a, color=green, xtickmarks=[-a,-a/2,a/2,a], ytickmarks=[-b,-b/2,b/2,b], view=[-a..a,-b..b]): display(PlotA,PlotF,PlotG); print(Approximations); evalf(ydata); |
> | print(Actual); evalf(f(x[0])); |
> | print(Actual-last_approximation); evalf(f(x[0])-ydata[9]); |
> |
> |
> |